<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue 过渡效果</title>
</head>
<body>
<style>
    .fade-enter-active, .fade-leave-active {
        transition: opacity .5s
    }

    .fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */
    {
        opacity: 0
    }
</style>
<div id="app">
    <button v-on:click="show =!show">toggle</button>
    <label>{{show}}</label>
    <br>
    <transition name="fade">
        <p v-if="show">hello</p>
    </transition>

</div>
<script src="./node_modules/vue/dist/vue.min.js"></script>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            show: true
        }
    })
</script>
</body>
</html>